antlr_target(PLCSTLexer PLCSTLexer.g4
            PACKAGE plcst
            LEXER
            )

antlr_target(PLCSTParser PLCSTParser.g4
            PACKAGE plcst
            DEPENDS_ANTLR PLCSTLexer
            PARSER
            LISTENER
            VISITOR
            COMPILE_FLAGS -lib 
            ${ANTLR_PLCSTLexer_OUTPUT_DIR}
            )

include_directories(${ANTLR_PLCSTLexer_OUTPUT_DIR}) 
set(ANTLR_PLCSTLexer_OUTPUT_DIR ${ANTLR_PLCSTLexer_OUTPUT_DIR} CACHE STRING "ANTLR_PLCSTLexer_OUTPUT_DIR")
include_directories(${ANTLR_PLCSTParser_OUTPUT_DIR})
set(ANTLR_PLCSTParser_OUTPUT_DIR ${ANTLR_PLCSTParser_OUTPUT_DIR} CACHE STRING "ANTLR_PLCSTParser_OUTPUT_DIR")

add_library(antlr_generated 
    ${ANTLR_PLCSTLexer_CXX_OUTPUTS} 
    ${ANTLR_PLCSTParser_CXX_OUTPUTS}
)

target_link_libraries(antlr_generated
    PUBLIC
    antlr4_static
)